﻿using UnityEngine;

namespace UFrame
{
    public class QuaternionTool
    {
        /// <summary>
        /// 用于一个平面朝向敌人
        /// </summary>
        public static Quaternion LookYAxis(Vector3 aPos, Vector3 bPos)
        {
            var p = aPos - bPos;
            Quaternion q = Quaternion.identity;
            q.SetLookRotation(p, Vector3.up);
            q.x = 0; //忽略某轴旋转
            q.z = 0;
            return q;
        }
    }
}